<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/include/TLDInclude.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>客户资料录入</title>
<link href="<%=request.getContextPath()%>/css/style.css" rel="stylesheet" type="text/css" />
<link href="<%=request.getContextPath()%>/css/select.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/js/select-ui.min.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/pinyin.js"></script>

<script type="text/javascript">
$(document).ready(function(e) {
    $(".select1").uedSelect({
		width : 345			  
	});
	$(".select2").uedSelect({
		width : 167  
	});
	$(".select3").uedSelect({
		width : 100
	});
	
	$("#name").blur(function () {
	var str=ConvertPinyin($("#name").val());
	$("#pinyin").val(str);
    });
	
});






function checkdata(){
	  if ($("#pinyin").val() == '' || $("#name").val() == '' || $("#passportno").val() == '' || $("#phoneno").val() == '') {
		  alert("带*的值必须录入");
		  return false;
	  }
	return true;
}
</script>

</head>

<body>
<c:if test="${not empty msg}">
			<div id="message" style="color: red;" align="center">
				${msg}
			</div>
</c:if>
	<div class="place">
    <span>位置：</span>
    <ul class="placeul">
    <li><a href="#">首页</a></li>
    <li><a href="#">客户资料</a></li>
    </ul>
    </div>
    
    <div class="formbody">
    
    <div class="formtitle"><span>客户资料录入</span></div>
    <form:form action="${ctx}/admin/clientadd" method="post" modelAttribute="client" >
    <input type=hidden name="clientId"  value="${client.clientId}"/>
    <ul class="forminfo">
    <li><label>姓名</label><input id="name" name="name" type="text" value="${client.name}" class="dfinput" /><i>*</i></li>
    <li><label>拼音</label><input id="pinyin" name="pinyin" type="text" value="${client.pinyin}" class="dfinput" /><i>*</i></li>
    <li><label>性别</label><cite><input name="sex"  type="radio" value="男" <c:if test="${client.sex eq '男'}">checked="checked"</c:if>  />男&nbsp;&nbsp;&nbsp;&nbsp;<input name="sex" type="radio" <c:if test="${client.sex eq '女'}">checked="checked"</c:if> value="女" />女</cite></li>
     <li><label>护照号码</label><input id="passportno" name="passportno" value="${client.passportno}"  type="text" class="dfinput" /><i>*</i></li>
    <li><label>手机号码</label><input id="phoneno" name="phoneno" value="${client.phoneno}" type="text" class="dfinput" /><i>*</i></li>
   <li><label>选择同行</label>
    <div class="vocation">
   <select class="select1" name="peerId">
   <option value="">无同行</option>
    <c:forEach items= "${peers}" var="peer">
    <option <c:if test= "${peer.peerId eq client.peerId}">
                                                       selected="selected"
                                                 </c:if>
     value="${peer.peerId}">${peer.name}</option>
    </c:forEach>
    </select>
    </div>
    </li>
    <!-- <li><label>出生地</label><input name="" type="text" class="dfinput" /></li>
    <li><label>签发地</label><input name="" type="text" class="dfinput" /><i></i></li> -->
  
    <li><label>QQ</label><input name="qq" value="${client.qq}" type="text" class="dfinput"  /></li>
    <li><label>邮箱</label><input name="email" value="${client.email}"  type="text" class="dfinput" /></li>
    <li><label>备注</label><input id="comment" name="comment" value="${client.comment}" type="text" class="dfinput" /></li>
   <!--  <li><label>出生年月日</label><input name="" type="text" class="dfinput"  /></li>
    <li><label>护照签发日期</label><input name="" type="text" class="dfinput" /></li>
    <li><label>护照到期日期</label><input name="" type="text" class="dfinput"  /></li> -->
    <li><label>&nbsp;</label><input name="" type="submit" onclick="javascript:return checkdata()" class="btn" value="确认保存"/></li>
    </ul>
    
    </form:form>
    </div>


</body>

</html>
